home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 1.8 KB | 72 lines | [TEXT/MPS ] |
- // UScriptMenu.h
- // Copyright © 1989-96 by Apple Computer, Inc. All rights reserved.
-
- // This behavior adds support for a "Scripts" folder and menu.
- // The "Scripts" folder may contain global, startup, and shared
- // handler scripts which are inserted into the OSA event handling
- // system. Additional scripts are added to a "Scripts" menu.
-
- #ifndef __USCRIPTMENU__
- #define __USCRIPTMENU__
-
- // MacApp
-
- #ifndef __PASCALSTRING__
- #include "PascalString.h"
- #endif
-
- #ifndef __UBEHAVIOR__
- #include "UBehavior.h"
- #endif
-
- // Toolbox
-
- #ifndef __COMPONENTS__
- #include <Components.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
-
- const short mScripts = 66; // Kind of a weird number which hopefully won't conflict with any of your existing menu ids
-
- const short kScriptMenuStrings = 66;
- const short kFolderName = 1;
- const short kGlobalsScript = 2;
- const short kSharedScript = 3;
- const short kStartupScript = 4;
-
- class TScriptMenuBehavior : public TBehavior
- {
- MA_DECLARE_CLASS;
-
- public:
- FSSpec fScriptFolder;
-
- TScriptMenuBehavior();
- virtual ~TScriptMenuBehavior();
-
- virtual void IScriptMenuBehavior();
- // Initialize the TScriptMenuBehavior
-
- void InstallGlobalsScript(ComponentInstance theCmp,
- const CStr63& scriptFolderName,
- const CStr63& globalsScriptName,
- long& stdScriptsFound);
- void InstallSharedScript(ComponentInstance theCmp,
- const CStr63& sharedScriptName,
- long& stdScriptsFound);
- void ExecuteStartupScript(ComponentInstance theCmp,
- const CStr63& startupScriptName,
- long& stdScriptsFound);
- void AddScriptMenu(const CStr63& globalsScriptName,
- const CStr63& sharedScriptName,
- const CStr63& startupScriptName,
- long& stdScriptsFound);
-
- virtual void DoMenuCommand(CommandNumber aCommandNumber);
- };
-
- #endif // __USCRIPTMENU__